/**
 * Copyright (c), 上海沃恩信息科技有限公司.
 * All rights reserved.
 * Licensed under BSD (https://www.pittypat.work/bsd.html).
 */

package pittypat.web;

import java.util.HashMap;

/**
 * 获取指定文件扩展名称的 MIME 类型。
 */
public final class Mime {
	private Mime() {
	}

	// 预定义的 MIME 类型列表
	private static final HashMap<String, String> TYPES = new HashMap<String, String>();
	static {
		TYPES.put(".323", "text/h323");
		TYPES.put(".3g2", "video/3gpp2");
		TYPES.put(".3gp2", "video/3gpp2");
		TYPES.put(".3gp", "video/3gpp");
		TYPES.put(".3gpp", "video/3gpp");
		TYPES.put(".aac", "audio/aac");
		TYPES.put(".aaf", "audio/aac");
		TYPES.put(".aab", "application/x-authoware-bin");
		TYPES.put(".aam", "application/x-authoware-map");
		TYPES.put(".aas", "application/x-authoware-seg");
		TYPES.put(".accdb", "application/msaccess");
		TYPES.put(".accde", "application/msaccess");
		TYPES.put(".accdt", "application/msaccess");
		TYPES.put(".acx", "application/internet-property-stream");
		TYPES.put(".adt", "audio/vnd.dlna.adts");
		TYPES.put(".adts", "audio/vnd.dlna.adts");
		TYPES.put(".afm", "application/octet-stream");
		TYPES.put(".ai", "application/postscript");
		TYPES.put(".aif", "audio/x-aiff");
		TYPES.put(".aifc", "audio/x-aiff");
		TYPES.put(".aiff", "audio/x-aiff");
		TYPES.put(".als", "audio/X-Alpha5");
		TYPES.put(".amc", "application/x-mpeg");
		TYPES.put(".ani", "application/octet-stream");
		TYPES.put(".apk", "application/vnd.android.package-archive");
		TYPES.put(".appcache", "text/cache-manifest");
		TYPES.put(".application", "application/x-ms-application");
		TYPES.put(".art", "image/x-jg");
		TYPES.put(".asc", "text/plain");
		TYPES.put(".asd", "application/astound");
		TYPES.put(".asf", "video/x-ms-asf");
		TYPES.put(".asi", "application/octet-stream");
		TYPES.put(".asm", "text/plain");
		TYPES.put(".asn", "application/astound");
		TYPES.put(".asp", "application/x-asap");
		TYPES.put(".asr", "video/x-ms-asf");
		TYPES.put(".asx", "video/x-ms-asf");
		TYPES.put(".atom", "application/atom+xml");
		TYPES.put(".au", "audio/basic");
		TYPES.put(".avb", "application/octet-stream");
		TYPES.put(".avi", "video/x-msvideo");
		TYPES.put(".awb", "audio/amr-wb");
		TYPES.put(".axs", "application/olescript");
		TYPES.put(".bas", "text/plain");
		TYPES.put(".bcpio", "application/x-bcpio");
		TYPES.put(".bin ", "application/octet-stream");
		TYPES.put(".bld", "application/bld");
		TYPES.put(".bld2", "application/bld2");
		TYPES.put(".bmp", "image/bmp");
		TYPES.put(".bpk", "application/octet-stream");
		TYPES.put(".bz2", "application/x-bzip2");
		TYPES.put(".c", "text/plain");
		TYPES.put(".cab", "application/vnd.ms-cab-compressed");
		TYPES.put(".cal", "image/x-cals");
		TYPES.put(".calx", "application/vnd.ms-office.calx");
		TYPES.put(".cat", "application/vnd.ms-pki.seccat");
		TYPES.put(".ccn", "application/x-cnc");
		TYPES.put(".cco", "application/x-cocoa");
		TYPES.put(".cdf", "application/x-cdf");
		TYPES.put(".cer", "application/x-x509-ca-cert");
		TYPES.put(".cgi", "magnus-internal/cgi");
		TYPES.put(".chat", "application/x-chat");
		TYPES.put(".chm", "application/octet-stream");
		TYPES.put(".class", "application/x-java-applet");
		TYPES.put(".clp", "application/x-msclip");
		TYPES.put(".cmx", "image/x-cmx");
		TYPES.put(".cnf", "text/plain");
		TYPES.put(".co", "application/x-cult3d-object");
		TYPES.put(".cod", "image/cis-cod");
		TYPES.put(".conf", "text/plain");
		TYPES.put(".config", "text/xml");
		TYPES.put(".cpio", "application/x-cpio");
		TYPES.put(".cpp", "text/plain");
		TYPES.put(".cpt", "application/mac-compactpro");
		TYPES.put(".crd", "application/x-mscardfile");
		TYPES.put(".crl", "application/pkix-crl");
		TYPES.put(".crt", "application/x-x509-ca-cert");
		TYPES.put(".csh", "application/x-csh");
		TYPES.put(".csm", "chemical/x-csml");
		TYPES.put(".csml", "chemical/x-csml");
		TYPES.put(".css", "text/css");
		TYPES.put(".csv", "application/octet-stream");
		TYPES.put(".cur", "application/octet-stream");
		TYPES.put(".dcm", "x-lml/x-evm");
		TYPES.put(".dcr", "application/x-director");
		TYPES.put(".dcx", "image/x-dcx");
		TYPES.put(".deploy", "application/octet-stream");
		TYPES.put(".der", "application/x-x509-ca-cert");
		TYPES.put(".dhtml", "text/html");
		TYPES.put(".dir", "application/x-director");
		TYPES.put(".disco", "text/xml");
		TYPES.put(".dll", "application/x-msdownload");
		TYPES.put(".dll.config", "text/xml");
		TYPES.put(".dlm", "text/dlm");
		TYPES.put(".dmg", "application/octet-stream");
		TYPES.put(".dms", "application/octet-stream");
		TYPES.put(".doc", "application/msword");
		TYPES.put(".docm", "application/vnd.ms-word.document.macroEnabled.12");
		TYPES.put(".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
		TYPES.put(".dot", "application/msword");
		TYPES.put(".dotm", "application/vnd.ms-word.template.macroEnabled.12");
		TYPES.put(".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template");
		TYPES.put(".dsp", "application/octet-stream");
		TYPES.put(".dtd", "text/xml");
		TYPES.put(".dvi", "application/x-dvi");
		TYPES.put(".dvi-ms", "video/x-ms-dvr");
		TYPES.put(".dwf", "drawing/x-dwf");
		TYPES.put(".dwg", "application/x-autocad");
		TYPES.put(".dwp", "application/octet-stream");
		TYPES.put(".dxf", "application/x-autocad");
		TYPES.put(".dxr", "application/x-director");
		TYPES.put(".ebk", "application/x-expandedbook");
		TYPES.put(".emb", "chemical/x-embl-dl-nucleotide");
		TYPES.put(".embl", "chemical/x-embl-dl-nucleotide");
		TYPES.put(".eml", "message/rfc822");
		TYPES.put(".emz", "application/octet-stream");
		TYPES.put(".eot", "application/vnd.ms-fontobject");
		TYPES.put(".eps", "application/postscript");
		TYPES.put(".epub", "application/epub+zip");
		TYPES.put(".eri", "image/x-eri");
		TYPES.put(".es", "audio/echospeech");
		TYPES.put(".esl", "audio/echospeech");
		TYPES.put(".etc", "application/x-earthtime");
		TYPES.put(".etx", "text/x-setext");
		TYPES.put(".evm", "x-lml/x-evm");
		TYPES.put(".evy", "application/envoy");
		TYPES.put(".exe", "application/octet-stream");
		TYPES.put(".exe.config", "text/xml");
		TYPES.put(".fdf", "application/vnd.fdf");
		TYPES.put(".fh4", "image/x-freehand");
		TYPES.put(".fh5", "image/x-freehand");
		TYPES.put(".fhc", "image/x-freehand");
		TYPES.put(".fif", "application/fractals");
		TYPES.put(".fla", "application/octet-stream");
		TYPES.put(".flr", "x-world/x-vrml");
		TYPES.put(".flv", "video/x-flv");
		TYPES.put(".fm", "application/x-maker");
		TYPES.put(".fpx", "image/x-fpx");
		TYPES.put(".fvi", "video/isivideo");
		TYPES.put(".gau", "chemical/x-gaussian-input");
		TYPES.put(".gca", "application/x-gca-compressed");
		TYPES.put(".gdb", "x-lml/x-gdb");
		TYPES.put(".gif", "image/gif");
		TYPES.put(".gps", "application/x-gps");
		TYPES.put(".gtar", "application/x-gtar");
		TYPES.put(".gz", "application/x-gzip");
		TYPES.put(".h", "text/plain");
		TYPES.put(".hdf", "application/x-hdf");
		TYPES.put(".hdm", "text/x-hdml");
		TYPES.put(".hdml", "text/x-hdml");
		TYPES.put(".hhc", "application/x-oleobject");
		TYPES.put(".hhk", "application/octet-stream");
		TYPES.put(".hhp", "application/octet-stream");
		TYPES.put(".hlp", "application/winhlp");
		TYPES.put(".hqx", "application/mac-binhex40");
		TYPES.put(".hta", "application/hta");
		TYPES.put(".htc", "text/x-component");
		TYPES.put(".htm", "text/html");
		TYPES.put(".html", "text/html");
		TYPES.put(".hts", "text/html");
		TYPES.put(".htt", "text/webviewhtml");
		TYPES.put(".hxt", "text/html");
		TYPES.put(".ice", "x-conference/x-cooltalk");
		TYPES.put(".ico", "image/x-icon");
		TYPES.put(".ics", "text/calendar");
		TYPES.put(".ief", "image/ief");
		TYPES.put(".ifm", "image/gif");
		TYPES.put(".ifs", "image/ifs");
		TYPES.put(".iii", "application/x-iphone");
		TYPES.put(".imy", "audio/melody");
		TYPES.put(".inf", "application/octet-stream");
		TYPES.put(".ini", "text/plain");
		TYPES.put(".ins", "application/x-internet-signup");
		TYPES.put(".ips", "application/x-ipscript");
		TYPES.put(".ipx", "application/x-ipix");
		TYPES.put(".isp", "application/x-internet-signup");
		TYPES.put(".it", "audio/x-mod");
		TYPES.put(".itz", "audio/x-mod");
		TYPES.put(".ivf", "video/x-ivf");
		TYPES.put(".ivr", "i-world/i-vrml");
		TYPES.put(".j2k", "image/j2k");
		TYPES.put(".jad", "text/vnd.sun.j2me.app-descriptor");
		TYPES.put(".jam", "application/x-jam");
		TYPES.put(".jar", "application/java-archive");
		TYPES.put(".java", "text/plain");
		TYPES.put(".jck", "application/liquidmotion");
		TYPES.put(".jcz", "application/liquidmotion");
		TYPES.put(".jfif", "image/pipeg");
		TYPES.put(".jnlp", "application/x-java-jnlp-file");
		TYPES.put(".jpb", "application/octet-stream");
		TYPES.put(".jpe", "image/jpeg");
		TYPES.put(".jpeg", "image/jpeg");
		TYPES.put(".jpg", "image/jpeg");
		TYPES.put(".jpz", "image/jpeg");
		TYPES.put(".js", "application/javascript");
		TYPES.put(".json", "application/json");
		TYPES.put(".jsonld", "application/ld+json");
		TYPES.put(".jsx", "text/jscript");
		TYPES.put(".jwc", "application/jwc");
		TYPES.put(".kjx", "application/x-kjx");
		TYPES.put(".lak", "x-lml/x-lak");
		TYPES.put(".latex", "application/x-latex");
		TYPES.put(".lcc", "application/fastman");
		TYPES.put(".lcl", "application/x-digitalloca");
		TYPES.put(".lcr", "application/x-digitalloca");
		TYPES.put(".less", "text/css");
		TYPES.put(".lgh", "application/lgh");
		TYPES.put(".lha", "application/octet-stream");
		TYPES.put(".lit", "application/x-ms-reader");
		TYPES.put(".lml", "x-lml/x-lml");
		TYPES.put(".lmlpack", "x-lml/x-lmlpack");
		TYPES.put(".log", "text/plain");
		TYPES.put(".lpk", "application/octet-stream");
		TYPES.put(".lsf", "video/x-la-asf");
		TYPES.put(".lsx", "video/x-la-asf");
		TYPES.put(".lzh", "application/octet-stream");
		TYPES.put(".m13", "application/x-msmediaview");
		TYPES.put(".m14", "application/x-msmediaview");
		TYPES.put(".m15", "audio/x-mod");
		TYPES.put(".m1v", "video/mpeg");
		TYPES.put(".m2ts", "video/vnd.dlna.mpeg-tts");
		TYPES.put(".m3u", "audio/x-mpegurl");
		TYPES.put(".m3url", "audio/x-mpegurl");
		TYPES.put(".m4a", "audio/mp4a-latm");
		TYPES.put(".m4b", "audio/mp4a-latm");
		TYPES.put(".m4p", "audio/mp4a-latm");
		TYPES.put(".m4u", "video/vnd.mpegurl");
		TYPES.put(".m4v", "video/x-m4v");
		TYPES.put(".ma1", "audio/ma1");
		TYPES.put(".ma2", "audio/ma2");
		TYPES.put(".ma3", "audio/ma3");
		TYPES.put(".ma5", "audio/ma5");
		TYPES.put(".man", "application/x-troff-man");
		TYPES.put(".manifest", "application/x-ms-manifest");
		TYPES.put(".map", "magnus-internal/imagemap");
		TYPES.put(".mbd", "application/mbedlet");
		TYPES.put(".mct", "application/x-mascot");
		TYPES.put(".mdb", "application/x-msaccess");
		TYPES.put(".mdp", "application/octet-stream");
		TYPES.put(".mdz", "audio/x-mod");
		TYPES.put(".me", "application/x-troff-me");
		TYPES.put(".mel", "text/x-vmel");
		TYPES.put(".mht", "message/rfc822");
		TYPES.put(".mhtml", "message/rfc822");
		TYPES.put(".mi", "application/x-mif");
		TYPES.put(".mid", "audio/mid");
		TYPES.put(".midi", "audio/midi");
		TYPES.put(".mif", "application/x-mif");
		TYPES.put(".mil", "image/x-cals");
		TYPES.put(".mio", "audio/x-mio");
		TYPES.put(".mix", "application/octet-stream");
		TYPES.put(".mmf", "application/x-skt-lbs");
		TYPES.put(".mng", "video/x-mng");
		TYPES.put(".mno", "text/xml");
		TYPES.put(".mny", "application/x-msmoney");
		TYPES.put(".moc", "application/x-mocha");
		TYPES.put(".mocha", "application/x-mocha");
		TYPES.put(".mod", "audio/x-mod");
		TYPES.put(".mof", "application/x-yumekara");
		TYPES.put(".mol", "chemical/x-mdl-molfile");
		TYPES.put(".mop", "chemical/x-mopac-input");
		TYPES.put(".mov", "video/quicktime");
		TYPES.put(".movie", "video/x-sgi-movie");
		TYPES.put(".mp2", "video/mpeg");
		TYPES.put(".mp3", "audio/mpeg");
		TYPES.put(".mp4", "video/mp4");
		TYPES.put(".mpa", "video/mpeg");
		TYPES.put(".mpc", "application/vnd.mpohun.certificate");
		TYPES.put(".mpe", "video/mpeg");
		TYPES.put(".mpeg", "video/mpeg");
		TYPES.put(".mpg", "video/mpeg");
		TYPES.put(".mpg4", "video/mp4");
		TYPES.put(".mpga", "audio/mpeg");
		TYPES.put(".mpn", "application/vnd.mophun.application");
		TYPES.put(".mpp", "application/vnd.ms-project");
		TYPES.put(".mps", "application/x-mapserver");
		TYPES.put(".mpv2", "video/mpeg");
		TYPES.put(".mrl", "text/x-mrml");
		TYPES.put(".mrm", "application/x-mrm");
		TYPES.put(".ms", "application/x-troff-ms");
		TYPES.put(".msg", "application/vnd.ms-outlook");
		TYPES.put(".msi", "application/octet-stream");
		TYPES.put(".mso", "application/octet-stream");
		TYPES.put(".mts", "application/metastream");
		TYPES.put(".mtx", "application/metastream");
		TYPES.put(".mtz", "application/metastream");
		TYPES.put(".mvb", "application/x-msmediaview");
		TYPES.put(".mvc", "application/x-miva-compiled");
		TYPES.put(".mzv", "application/metastream");
		TYPES.put(".nar", "application/zip");
		TYPES.put(".nbmp", "image/nbmp");
		TYPES.put(".nc", "application/x-netcdf");
		TYPES.put(".ndb", "x-lml/x-ndb");
		TYPES.put(".ndwn", "application/ndwn");
		TYPES.put(".nif", "application/x-nif");
		TYPES.put(".nmz", "application/x-scream");
		TYPES.put(".nokia-op-logo", "image/vnd.nok-oplogo-color");
		TYPES.put(".npx", "application/x-netfpx");
		TYPES.put(".nsc", "video/x-ms-asf");
		TYPES.put(".nsnd", "audio/nsnd");
		TYPES.put(".nva", "application/x-neva1");
		TYPES.put(".nws", "message/rfc822");
		TYPES.put(".ocx", "application/octet-stream");
		TYPES.put(".oda", "application/oda");
		TYPES.put(".odc", "text/x-ms-odc");
		TYPES.put(".ods", "application/oleobject");
		TYPES.put(".oga", "audio/ogg");
		TYPES.put(".ogg", "video/ogg");
		TYPES.put(".ogv", "video/ogg");
		TYPES.put(".one", "application/onenote");
		TYPES.put(".onea", "application/onenote");
		TYPES.put(".onetoc", "application/onenote");
		TYPES.put(".onetoc2", "application/onenote");
		TYPES.put(".onetmp", "application/onenote");
		TYPES.put(".onepkg", "application/onenote");
		TYPES.put(".osdx", "application/opensearchdescription+xml");
		TYPES.put(".oom", "application/x-AtlasMate-Plugin");
		TYPES.put(".otf", "font/opentype");
		TYPES.put(".p10", "application/pkcs10");
		TYPES.put(".p12", "application/x-pkcs12");
		TYPES.put(".p7b", "application/x-pkcs7-certificates");
		TYPES.put(".p7c", "application/x-pkcs7-mime");
		TYPES.put(".p7m", "application/x-pkcs7-mime");
		TYPES.put(".p7r", "application/x-pkcs7-certreqresp");
		TYPES.put(".p7s", "application/x-pkcs7-user_signature_t");
		TYPES.put(".pac", "audio/x-pac");
		TYPES.put(".pae", "audio/x-epac");
		TYPES.put(".pan", "application/x-pan");
		TYPES.put(".pbm", "image/x-portable-bitmap");
		TYPES.put(".pcx", "image/x-pcx");
		TYPES.put(".pcz", "application/octet-stream");
		TYPES.put(".pda", "image/x-pda");
		TYPES.put(".pdb", "chemical/x-pdb");
		TYPES.put(".pdf", "application/pdf");
		TYPES.put(".pfb", "application/octet-stream");
		TYPES.put(".pfm", "application/octet-stream");
		TYPES.put(".pfr", "application/font-tdpfr");
		TYPES.put(".pfx", "application/x-pkcs12");
		TYPES.put(".pgm", "image/x-portable-graymap");
		TYPES.put(".pict", "image/x-pict");
		TYPES.put(".pko", "application/ynd.ms-pkipko");
		TYPES.put(".pm", "application/x-perl");
		TYPES.put(".pma", "application/x-perfmon");
		TYPES.put(".pmc", "application/x-perfmon");
		TYPES.put(".pmd", "application/x-pmd");
		TYPES.put(".pml", "application/x-perfmon");
		TYPES.put(".pmr", "application/x-perfmon");
		TYPES.put(".pmw", "application/x-perfmon");
		TYPES.put(".png", "image/png");
		TYPES.put(".pnm", "image/x-portable-anymap");
		TYPES.put(".pnz", "image/png");
		TYPES.put(".pot", "application/vnd.ms-powerpoint");
		TYPES.put(".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12");
		TYPES.put(".potx", "application/vnd.openxmlformats-officedocument.presentationml.template");
		TYPES.put(".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12");
		TYPES.put(".ppm", "image/x-portable-pixmap");
		TYPES.put(".pps", "application/vnd.ms-powerpoint");
		TYPES.put(".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12");
		TYPES.put(".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow");
		TYPES.put(".ppt", "application/vnd.ms-powerpoint");
		TYPES.put(".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12");
		TYPES.put(".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
		TYPES.put(".pqf", "application/x-cprplayer");
		TYPES.put(".pqi", "application/cprplayer");
		TYPES.put(".prc", "application/x-prc");
		TYPES.put(".prf", "application/pics-rules");
		TYPES.put(".prm", "application/octet-stream");
		TYPES.put(".prop", "text/plain");
		TYPES.put(".proxy", "application/x-ns-proxy-autoconfig");
		TYPES.put(".prx", "application/octet-stream");
		TYPES.put(".ps", "application/postscript");
		TYPES.put(".psd", "application/octet-stream");
		TYPES.put(".psm", "application/octet-stream");
		TYPES.put(".psp", "application/octet-stream");
		TYPES.put(".ptlk", "application/listenup");
		TYPES.put(".pub", "application/x-mspublisher");
		TYPES.put(".pvx", "video/x-pv-pvx");
		TYPES.put(".qcp", "audio/vnd.qcelp");
		TYPES.put(".qt", "video/quicktime");
		TYPES.put(".qti", "image/x-quicktime");
		TYPES.put(".qtif", "image/x-quicktime");
		TYPES.put(".qtl", "application/x-quicktimeplayer");
		TYPES.put(".qxd", "application/octet-stream");
		TYPES.put(".r3t", "text/vnd.rn-realtext3d");
		TYPES.put(".ra", "audio/x-pn-realaudio");
		TYPES.put(".ram", "audio/x-pn-realaudio");
		TYPES.put(".rar", "application/octet-stream");
		TYPES.put(".ras", "image/x-cmu-raster");
		TYPES.put(".rc", "text/plain");
		TYPES.put(".rdf", "application/rdf+xml");
		TYPES.put(".rf", "image/vnd.rn-realflash");
		TYPES.put(".rgb", "image/x-rgb");
		TYPES.put(".rlf", "application/x-richlink");
		TYPES.put(".rm", "audio/x-pn-realaudio");
		TYPES.put(".rmf", "audio/x-rmf");
		TYPES.put(".rmi", "audio/mid");
		TYPES.put(".rmm", "audio/x-pn-realaudio");
		TYPES.put(".rmvb", "audio/x-pn-realaudio");
		TYPES.put(".rnx", "application/vnd.rn-realplayer");
		TYPES.put(".roff", "application/x-troff");
		TYPES.put(".rp", "image/vnd.rn-realpix");
		TYPES.put(".rpm", "audio/x-pn-realaudio-plugin");
		TYPES.put(".rt", "text/vnd.rn-realtext");
		TYPES.put(".rte", "x-lml/x-gps");
		TYPES.put(".rtf", "application/rtf");
		TYPES.put(".rtg", "application/metastream");
		TYPES.put(".rtx", "text/richtext");
		TYPES.put(".rv", "video/vnd.rn-realvideo");
		TYPES.put(".rwc", "application/x-rogerwilco");
		TYPES.put(".s3m", "audio/x-mod");
		TYPES.put(".s3z", "audio/x-mod");
		TYPES.put(".sca", "application/x-supercard");
		TYPES.put(".scd", "application/x-msschedule");
		TYPES.put(".sct", "text/scriptlet");
		TYPES.put(".sdf", "application/e-score");
		TYPES.put(".sea", "application/x-stuffit");
		TYPES.put(".setpay", "application/set-payment-initiation");
		TYPES.put(".setreg", "application/set-registration-initiation");
		TYPES.put(".sgm", "text/sgml");
		TYPES.put(".sgml", "text/sgml");
		TYPES.put(".sh", "application/x-sh");
		TYPES.put(".shar", "application/x-shar");
		TYPES.put(".shtml", "magnus-internal/parsed-html");
		TYPES.put(".shw", "application/presentations");
		TYPES.put(".si6", "image/si6");
		TYPES.put(".si7", "image/vnd.stiwap.sis");
		TYPES.put(".si9", "image/vnd.lgtwap.sis");
		TYPES.put(".sis", "application/vnd.symbian.install");
		TYPES.put(".sit", "application/x-stuffit");
		TYPES.put(".skd", "application/x-Koan");
		TYPES.put(".skm", "application/x-Koan");
		TYPES.put(".skp", "application/x-Koan");
		TYPES.put(".skt", "application/x-Koan");
		TYPES.put(".slc", "application/x-salsa");
		TYPES.put(".smd", "audio/x-smd");
		TYPES.put(".smi", "application/smil");
		TYPES.put(".smil", "application/smil");
		TYPES.put(".smp", "application/studiom");
		TYPES.put(".smz", "audio/x-smd");
		TYPES.put(".snd", "audio/basic");
		TYPES.put(".spc", "application/x-pkcs7-certificates");
		TYPES.put(".spl", "application/futuresplash");
		TYPES.put(".spr", "application/x-sprite");
		TYPES.put(".sprite", "application/x-sprite");
		TYPES.put(".sdp", "application/sdp");
		TYPES.put(".spt", "application/x-spt");
		TYPES.put(".src", "application/x-wais-source");
		TYPES.put(".sst", "application/vnd.ms-pkicertstore");
		TYPES.put(".stk", "application/hyperstudio");
		TYPES.put(".stl", "application/vnd.ms-pkistl");
		TYPES.put(".stm", "text/html");
		TYPES.put(".sv4cpio", "application/x-sv4cpio");
		TYPES.put(".sv4crc", "application/x-sv4crc");
		TYPES.put(".svf", "image/vnd");
		TYPES.put(".svg", "image/svg+xml");
		TYPES.put(".svgz", "image/svg+xml");
		TYPES.put(".svh", "image/svh");
		TYPES.put(".svr", "x-world/x-svr");
		TYPES.put(".swf", "application/x-shockwave-flash");
		TYPES.put(".swfl", "application/x-shockwave-flash");
		TYPES.put(".t", "application/x-troff");
		TYPES.put(".tad", "application/octet-stream");
		TYPES.put(".talk", "text/x-speech");
		TYPES.put(".tar", "application/x-tar");
		TYPES.put(".taz", "application/x-tar");
		TYPES.put(".tbp", "application/x-timbuktu");
		TYPES.put(".tbt", "application/x-timbuktu");
		TYPES.put(".tcl", "application/x-tcl");
		TYPES.put(".tex", "application/x-tex");
		TYPES.put(".texi", "application/x-texinfo");
		TYPES.put(".texinfo", "application/x-texinfo");
		TYPES.put(".tgz", "application/x-compressed");
		TYPES.put(".thm", "application/vnd.eri.thm");
		TYPES.put(".thmx", "application/vnd.ms-officetheme");
		TYPES.put(".thn", "application/octet-stream");
		TYPES.put(".tif", "image/tiff");
		TYPES.put(".tiff", "image/tiff");
		TYPES.put(".tki", "application/x-tkined");
		TYPES.put(".tkined", "application/x-tkined");
		TYPES.put(".toc", "application/toc");
		TYPES.put(".toy", "image/toy");
		TYPES.put(".tr", "application/x-troff");
		TYPES.put(".trk", "x-lml/x-gps");
		TYPES.put(".trm", "application/x-msterminal");
		TYPES.put(".ts", "video/vnd.dlna.mpeg-tts");
		TYPES.put(".tsi", "audio/tsplayer");
		TYPES.put(".tsp", "application/dsptype");
		TYPES.put(".tsv", "text/tab-separated-values");
		TYPES.put(".ttf", "font/ttf");
		TYPES.put(".tts", "video/vnd.dlna.mpeg-tts");
		TYPES.put(".ttz", "application/t-time");
		TYPES.put(".txt", "text/plain");
		TYPES.put(".u32", "application/octet-stream");
		TYPES.put(".uls", "text/iuls");
		TYPES.put(".ult", "audio/x-mod");
		TYPES.put(".ustar", "application/x-ustar");
		TYPES.put(".uu", "application/x-uuencode");
		TYPES.put(".uue", "application/x-uuencode");
		TYPES.put(".vbs", "text/vbscript");
		TYPES.put(".vcd", "application/x-cdlink");
		TYPES.put(".vcf", "text/x-vcard");
		TYPES.put(".vcs", "text/plain");
		TYPES.put(".vdo", "video/vdo");
		TYPES.put(".vdx", "application/vnd.ms-visio.viewer");
		TYPES.put(".vib", "audio/vib");
		TYPES.put(".viv", "video/vivo");
		TYPES.put(".vivo", "video/vivo");
		TYPES.put(".vmd", "application/vocaltec-media-desc");
		TYPES.put(".vmf", "application/vocaltec-media-file");
		TYPES.put(".vmi", "application/x-dreamcast-vms-info");
		TYPES.put(".vml", "text/xml");
		TYPES.put(".vms", "application/x-dreamcast-vms");
		TYPES.put(".vox", "audio/voxware");
		TYPES.put(".vqe", "audio/x-twinvq-plugin");
		TYPES.put(".vqf", "audio/x-twinvq");
		TYPES.put(".vql", "audio/x-twinvq");
		TYPES.put(".vre", "x-world/x-vream");
		TYPES.put(".vrml", "x-world/x-vrml");
		TYPES.put(".vrt", "x-world/x-vrt");
		TYPES.put(".vrw", "x-world/x-vream");
		TYPES.put(".vsd", "application/vnd.visio");
		TYPES.put(".vss", "application/vnd.visio");
		TYPES.put(".vst", "application/vnd.visio");
		TYPES.put(".vsto", "application/x-ms-vsto");
		TYPES.put(".vsw", "application/vnd.visio");
		TYPES.put(".vsx", "application/vnd.visio");
		TYPES.put(".vts", "workbook/formulaone");
		TYPES.put(".vtx", "application/vnd.visio");
		TYPES.put(".wav", "audio/x-wav");
		TYPES.put(".wax", "audio/x-ms-wax");
		TYPES.put(".wbmp", "image/vnd.wap.wbmp");
		TYPES.put(".wcm", "application/vnd.ms-works");
		TYPES.put(".wdb", "application/vnd.ms-works");
		TYPES.put(".web", "application/vnd.xara");
		TYPES.put(".webm", "video/webm");
		TYPES.put(".wi", "image/wavelet");
		TYPES.put(".wis", "application/x-InstallShield");
		TYPES.put(".wks", "application/vnd.ms-works");
		TYPES.put(".wm", "video/x-ms-wm");
		TYPES.put(".wma", "audio/x-ms-wma");
		TYPES.put(".wmd", "application/x-ms-wmd");
		TYPES.put(".wmf", "application/x-msmetafile");
		TYPES.put(".wml", "text/vnd.wap.wml");
		TYPES.put(".wmlc", "application/vnd.wap.wmlc");
		TYPES.put(".wmls", "text/vnd.wap.wmlscript");
		TYPES.put(".wmlsc", "application/vnd.wap.wmlscriptc");
		TYPES.put(".wmlscript", "text/vnd.wap.wmlscript");
		TYPES.put(".wmp", "video/x-ms-wmp");
		TYPES.put(".wmv", "video/x-ms-wmv");
		TYPES.put(".wmx", "video/x-ms-wmx");
		TYPES.put(".wmz", "application/x-ms-wmz");
		TYPES.put(".woff", "font/x-woff");
		TYPES.put(".woff2", "application/font-woff2");
		TYPES.put(".wpng", "image/x-up-wpng");
		TYPES.put(".wps", "application/vnd.ms-works");
		TYPES.put(".wpt", "x-lml/x-gps");
		TYPES.put(".wri", "application/x-mswrite");
		TYPES.put(".wrl", "x-world/x-vrml");
		TYPES.put(".wrz", "x-world/x-vrml");
		TYPES.put(".ws", "text/vnd.wap.wmlscript");
		TYPES.put(".wsc", "application/vnd.wap.wmlscriptc");
		TYPES.put(".wsdl", "text/xml");
		TYPES.put(".wtv", "video/x-ms-wtv");
		TYPES.put(".wv", "video/wavelet");
		TYPES.put(".wvx", "video/x-ms-wvx");
		TYPES.put(".wxl", "application/x-wxl");
		TYPES.put(".x", "application/directx");
		TYPES.put(".x-gzip", "application/x-gzip");
		TYPES.put(".xaf", "x-world/x-vrml");
		TYPES.put(".xaml", "application/xaml+xml");
		TYPES.put(".xap", "application/x-silverlight-app");
		TYPES.put(".xar", "application/vnd.xara");
		TYPES.put(".xbap", "application/x-ms-xbap");
		TYPES.put(".xbm", "image/x-xbitmap");
		TYPES.put(".xdm", "application/x-xdma");
		TYPES.put(".xdma", "application/x-xdma");
		TYPES.put(".xdr", "text/plain");
		TYPES.put(".xdw", "application/vnd.fujixerox.docuworks");
		TYPES.put(".xht", "application/xhtml+xml");
		TYPES.put(".xhtm", "application/xhtml+xml");
		TYPES.put(".xhtml", "application/xhtml+xml");
		TYPES.put(".xla", "application/vnd.ms-excel");
		TYPES.put(".xlam", "application/vnd.ms-excel.addin.macroEnabled.12");
		TYPES.put(".xlc", "application/vnd.ms-excel");
		TYPES.put(".xll", "application/x-excel");
		TYPES.put(".xlm", "application/vnd.ms-excel");
		TYPES.put(".xls", "application/vnd.ms-excel");
		TYPES.put(".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12");
		TYPES.put(".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12");
		TYPES.put(".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
		TYPES.put(".xlt", "application/vnd.ms-excel");
		TYPES.put(".xltm", "application/vnd.ms-excel.template.macroEnabled.12");
		TYPES.put(".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template");
		TYPES.put(".xlw", "application/vnd.ms-excel");
		TYPES.put(".xm", "audio/x-mod");
		TYPES.put(".xml", "text/plain");
		TYPES.put(".xmz", "audio/x-mod");
		TYPES.put(".xof", "x-world/x-vrml");
		TYPES.put(".xpi", "application/x-xpinstall");
		TYPES.put(".xpm", "image/x-xpixmap");
		TYPES.put(".xps", "application/vnd.ms-xpsdocument");
		TYPES.put(".xsd", "text/xml");
		TYPES.put(".xsf", "text/xml");
		TYPES.put(".xsl", "text/xml");
		TYPES.put(".xslt", "text/xml");
		TYPES.put(".xsn", "application/octet-stream");
		TYPES.put(".xtp", "application/octet-stream");
		TYPES.put(".xul", "text/xul");
		TYPES.put(".xwd", "image/x-xwindowdump");
		TYPES.put(".xyz", "chemical/x-pdb");
		TYPES.put(".yz1", "application/x-yz1");
		TYPES.put(".z", "application/x-compress");
		TYPES.put(".zac", "application/x-zaurus-zac");
		TYPES.put(".zip", "application/x-zip-compressed");
	}

	/**
	 * 获取指定扩展名称的 MIME 类型。
	 * 
	 * @param ext
	 *            文件的扩展名称，包含前面的 '.'。
	 * @return 文件的 MIME 类型。
	 */
	public static String of(String ext) {
		return ext == null || ext.length() == 0 ? "application/octet-stream"
				: TYPES.getOrDefault(ext.toLowerCase(), "application/octet-stream");
	}
}
